import Vue from 'vue'

const componentsContext = require.content('./global', true, /\.js$/)

componentsContext.keys().forEach(compontent => {
  const componentConfig = componentsContext(compontent)
  /**
   * 兼容 import export 和 require module.export 两种规范
   */
  const ctrl = componentConfig.default || componentConfig
  Vue.component(ctrl.name, ctrl);
})